function out=bandpass(y,fmin,fmax,dt)
N=length(y);
y=[y y(N:-1:N-(2^nextpow2(N)-N)+1)]; %reflecting the last element
N1=length(y);

C=fct(y);
freqs=(0:N1-1)/(2*N1*dt);

ind=find(~(freqs<fmax & freqs>fmin));
C(ind)=0;
out=ifct(C);
out=out(1:N);

%figure(1); plot(t,y);
%figure(2); plot(t,out);
